package com.longlong.cli;


import picocli.CommandLine;

@CommandLine.Command(name = "div", description = "除法运算", mixinStandardHelpOptions = true)
public class DivCommand implements Runnable {

    @CommandLine.Parameters(index = "0", description = "被除数")
    private int dividend;

    @CommandLine.Parameters(index = "1", description = "除数")
    private int divisor;

    @Override
    public void run() {
        if (divisor == 0) {
            System.out.println("除数不能为0");
        }
        else {
            System.out.println(dividend + " / " + divisor + " = ");
            System.out.println(dividend / divisor);
        }


    }

}
